package dk.pun.aot.client.event;

import com.google.gwt.event.shared.GwtEvent;

import dk.pun.aot.shared.character.SkillType;

public class SkillUpdatedEvent extends GwtEvent<SkillUpdatedEventHandler> {

	public static Type<SkillUpdatedEventHandler> TYPE = new Type<SkillUpdatedEventHandler>();

	private final SkillType type;
	private final int rank;

	public SkillUpdatedEvent(SkillType type, int rank) {
		this.type = type;
		this.rank = rank;
	}

	public SkillType getSkillType() {
		return this.type;
	}
	
	public int getSkillRank() {
		return this.rank;
	}

	@Override
	public Type<SkillUpdatedEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(SkillUpdatedEventHandler handler) {
		handler.onSkillUpdated(this);
	}

}
